import request from '@/config/axios';
import { baseUrl } from '@/config/env';
export const loginByUsername = (username, password, code, redomStr) => request({
  url: baseUrl + '/api/sys/user/login',
  method: 'post',
  meta: {
    isToken: false,
    isSerialize:true,
  },
  data: {
    username,
    password,
    code,
    redomStr
  }
})

export const logout = () => request({
  url: baseUrl + '/api/user/logout',
  meta: {
    isToken: false
  },
  method: 'get'
})

export const getUserInfo = () => request({
  url: baseUrl + '/api/user/getUserInfo',
  method: 'get'
});



export const getMenu = (type = 0,parentId =-1) => request({
  url: baseUrl + '/api/sys/menu/user',
  method: 'get',
  params: {
    type,
    parentId
  }
});

export const getTopMenu = () => request({
  url: baseUrl + '/api/user/getTopMenu',
  method: 'get'
});


